package com.vip.sys.modular.oshi.controller;

import com.vip.common.response.CommonResponse;
import com.vip.sys.modular.oshi.service.OshiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ASUS
 * @Date 2025/3/28 23:19
 * @Descripition
 */
@Tag(name = "系统监控控制器")
@RestController
@RequestMapping("/sys/oshi")
public class OshiController {
    @Resource
    private OshiService oshiService;

    @GetMapping("/getCpuInfo")
    @Operation(summary = "获取CPU信息")
    public CommonResponse getCpuInfo() {
        return CommonResponse.success(oshiService.getCpuInfo());
    }

    @GetMapping("/getJvmInfo")
    @Operation(summary = "获取JVM信息")
    public CommonResponse getJvmInfo() {
        return CommonResponse.success(oshiService.getJvmInfo());
    }

    @GetMapping("/getMemInfo")
    @Operation(summary = "获取内存信息")
    public CommonResponse getMemInfo() {
        return CommonResponse.success(oshiService.getMemInfo());
    }

    @GetMapping("/getSysInfo")
    @Operation(summary = "获取系统信息")
    public CommonResponse getSysInfo() {
        return CommonResponse.success(oshiService.getSysInfo());
    }

    @GetMapping("/getSysFileInfo")
    @Operation(summary = "获取系统文件信息")
    public CommonResponse getSysFileInfo() {
        return CommonResponse.success(oshiService.getSysFileInfo());
    }
}
